<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">
    <title>汉堡菜单按钮</title>
    <style>
        .app {
            width: 100%;
            height: 100vh;
            background-color: #ffffff;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .label16 {
            width: 48px;
            height: 36px;
            display: block;
            position: relative;
            cursor: pointer;
        }

        .inp16 {
            display: none;
        }

        .line16 {
            width: inherit;
            height: 4px;
            border-radius: 2px;
            display: block;
            background-color: #3d3d3d;
            position: absolute;
            top: 0;
            transition: all 0.24s ease-in-out;
        }

        .line16:nth-of-type(2) {
            top: 16px;
        }

        .line16:nth-of-type(3) {
            top: 32px;
        }

        .inp16:checked~.line16:nth-of-type(1) {
            transform: rotate(45deg);
            top: 16px;
        }

        .inp16:checked~.line16:nth-of-type(2) {
            width: 0;
        }

        .inp16:checked~.line16:nth-of-type(3) {
            transform: rotate(-45deg);
            top: 16px;
        }
    </style>
</head>

<body>
    <div class="app">
        <label class="label16">
            <input class="inp16" type="checkbox">
            <span class="line16"></span>
            <span class="line16"></span>
            <span class="line16"></span>
        </label>
    </div>
</body>

</html>